package com.hu.zhcc.shiro.controller;

import com.hu.zhcc.shiro.entity.bo.CheckItem;
import com.hu.zhcc.shiro.entity.bo.Questionnaire;
import com.hu.zhcc.shiro.service.CheckItemService;
import com.hu.zhcc.shiro.service.QuestionnaireService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/questionnaire")
public class QuestionnaireController {

    @Autowired
    private QuestionnaireService questionnaireService;

    @GetMapping("/{id}")
    public List<Questionnaire> getById(@PathVariable("id") int id) {
        return questionnaireService.select(id);
    }
}
